<?php

/**
 * Fily form.
 *
 * @package    jobeet
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class FilyForm extends BaseFilyForm
{
  public function configure()
  { //echo sfContext::getInstance()->getUser()->getAttribute('id');
  	 

  	    unset(
      $this['created_at'], $this['updated_at'], $this['dead'], $this['verify'], $this['is_detailed']
      , $this['label_serie'], $this['season'], $this['episode'], $this['actors_list'], $this['token']
      );
      
      $this->widgetSchema['language'] = new sfWidgetFormChoice(array(
  		'choices'  => Doctrine_Core::getTable('Fily')->getLanguages(),
  		'multiple' => false, 'expanded' => false
	  ));

 	  $this->validatorSchema['language'] = new sfValidatorChoice(array(
      'choices' => array_keys(Doctrine_Core::getTable('Fily')->getLanguages()),
      )); 
    
      $this->widgetSchema->setLabels(array(
     'category_id'   => 'Category',
     'label'		 => 'Titre',
     'language'      => 'Langue',
     'released_at'   => 'Sorti le',
     'url_image'     => 'Adresse de l\'image',
     'synopsis'		 => 'Resumé'
   	 ));
   	 
   	 $subForm = new sfForm();
  
     $link = new link();
     
     $link=sfContext::getInstance()->getUser()->getAttribute('link');
     $link->user_link_id=sfContext::getInstance()->getUser()->getAttribute('id');
     
     
     
     $link->Fily = $this->getObject();
     $form = new LinkForm($link);
 	  
  $this->embedForm("Url", $form);
  
   	 
   	 

  }
}
